package org.xbill.DNS.tests;

import java.io.PrintStream;
import java.util.Iterator;
import org.xbill.DNS.Name;
import org.xbill.DNS.Zone;

public class primary
{
  public static void main(String[] paramArrayOfString)
    throws Exception
  {
    int j;
    int k;
    int l;
    int i = 0;
    if (paramArrayOfString.length < 2)
    {
      usage();
      j = 0;
      k = 0;
      l = 0;
    }
    while (true)
    {
      int i1;
      int i2;
      int i3;
      Zone localZone;
      Iterator localIterator2;
      if (paramArrayOfString.length - i <= 2)
      {
        int i6 = i + 1;
        Name localName = Name.fromString(paramArrayOfString[i], Name.root);
        (i6 + 1);
        String str = paramArrayOfString[i6];
        long l1 = System.currentTimeMillis();
        localZone = new Zone(localName, str);
        long l2 = System.currentTimeMillis();
        if (l == 0)
          break label242;
        localIterator2 = localZone.AXFR();
        if (localIterator2.hasNext())
          break label226;
        if (j != 0)
          System.out.println("; Load time: " + (l2 - l1) + " ms");
        return;
      }
      if (paramArrayOfString[0].equals("-t"))
      {
        int i5 = k;
        i3 = 1;
        i1 = l;
        i2 = i5;
      }
      while (true)
      {
        while (true)
        {
          while (true)
          {
            while (true)
            {
              while (true)
              {
                while (true)
                {
                  ++i;
                  j = i3;
                  k = i2;
                  l = i1;
                }
                if (!(paramArrayOfString[0].equals("-a")))
                  break;
                i1 = 1;
                i2 = k;
                i3 = j;
              }
              if (!(paramArrayOfString[0].equals("-i")))
                break label290;
              i3 = j;
              int i4 = l;
              i2 = 1;
              i1 = i4;
            }
            label226: System.out.println(localIterator2.next());
          }
          if (k != 0)
          {
            label242: Iterator localIterator1 = localZone.iterator();
            while (true)
            {
              if (!(localIterator1.hasNext()));
              System.out.println(localIterator1.next());
            }
          }
          System.out.println(localZone);
        }
        label290: i1 = l;
        i2 = k;
        i3 = j;
      }
      j = 0;
      k = 0;
      l = 0;
    }
  }

  private static void usage()
  {
    System.out.println("usage: primary [-t] [-a | -i] origin file");
    System.exit(1);
  }
}